﻿@using thousandClear.Areas.Admin.Models;
@model List<GoodModel>
@{
    ViewBag.Title = "新增服务";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}
<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>

    <div class="am-tabs am-margin" data-am-tabs>

        <div class="am-tabs-bd">
            <form action="" onsubmit="return check()" method="post" class="am-form" id="doc-vld-msg">
                <fieldset>
                    <div class="am-form-group">
                        <label for="ogsDesc">服务名称：</label>
                        <input type="text" id="ogsDesc" placeholder="请服务名称(必填)如：包月" required v-model="ogsDesc" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSalePrice">销售价：</label>
                        <input type="number" id="ogsSalePrice" placeholder="请输入销售价(必填)" required v-model="ogsSalePrice" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsMarketPrice">市场价：</label>
                        <input type="number" id="ogsMarketPrice" placeholder="请输入市场价(非必填)" v-model="ogsMarketPrice" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsType">服务类型：</label>
                        <select id="ogsType" v-model="ogsType" v-on:change="changeType()">
                            <option value="1">单次服务</option>
                            <option value="6">包月</option>
                            <option value="2">包季度</option>
                            <option value="3">包半年</option>
                            <option value="4">包年</option>
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label for="ogsArea">面积：</label>
                        <select id="ogsArea" v-model="ogsArea">
                            <option value="0-200">0-200m<sup>2</sup></option>
                            <option value="200-300">200-300<sup>2</sup></option>
                            <option value="300-400">300-400<sup>2</sup></option>
                        </select>
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSignTime">服务时长：</label>
                        <input type="number" id="ogsSignTime" placeholder="请输入服务时长/月(必填)" required v-model="ogsSignTime" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsTimeMonth">每月次数：</label>
                        <input type="number" id="ogsTimeMonth" placeholder="请输入每月次数(非必填)" v-model="ogsTimeMonth" />
                    </div>
                    <div class="am-form-group">
                        <label for="ogsSeqNum">赠送次数：</label>
                        <input type="number" id="ogsSeqNum" placeholder="请输入赠送次数(非必填)" v-model="ogsSeqNum" />
                    </div>
                    <input type="hidden" name="data" v-bind:value="data" />
                    <button v-bind:click="test()" class="am-btn am-btn-secondary" type="submit">提交</button>
                </fieldset>
            </form>
        </div>
    </div>
</div>

@section Scripts{

    <script>
        var model = new Vue({
            el: '#app',
            data: {
                ogsDesc: '',
                ogsSalePrice: '',
                ogsMarketPrice: '',
                ogsType: 1,
                ogsSignTime: '0',
                ogsTimeMonth: '',
                ogsSeqNum: '0',
                ogsArea: '0-200'
            },
            computed: {
                data: function () {
                    return JSON.stringify(this._data);
                }
            },
            methods: {
                changeType: function () {
                    var self = this;
                    if (self.ogsType == 1) {
                        self.ogsSignTime = 0;
                    }
                }

            }

        })



        $('.admin-sidebar-Good').addClass('current');
    </script>
}

